<!DOCTYPE html>

<head>
    <title>yobot用户管理</title>
    <meta name='viewport' content='width=1000' charset="utf-8" />
    <script src="https://cdn.bootcdn.net/ajax/libs/vue/2.6.11/vue.min.js"></script>
    <script src="https://cdn.bootcdn.net/ajax/libs/axios/0.19.2/axios.min.js"></script>
    <script src="https://cdn.bootcdn.net/ajax/libs/element-ui/2.13.0/index.js"></script>
    <link rel="stylesheet" href="https://cdn.bootcdn.net/ajax/libs/element-ui/2.13.0/theme-chalk/index.css">
    <style>
        [icon="el-icon-delete"]{
            color: red;
        }
    </style>
</head>

<body>
    <div id="app">
        <el-page-header @back="location='..'" content="yobot用户管理"></el-page-header>
        <el-table :data="userData" style="width: 100%" v-loading="isLoading" stripe>
            <el-table-column label="详情页" width="30">
                <template slot-scope="scope">
                    <a :href="'../../user/' + scope.row.qqid + '/'"><i class="el-icon-user"></i></a>
                </template>
            </el-table-column>
            <el-table-column prop="nickname" label="昵称" width="200" sortable></el-table-column>
            <el-table-column prop="qqid" label="QQ号" width="120" sortable></el-table-column>
            <el-table-column prop="clan_group_id" label="公会战群号" width="120" sortable></el-table-column>
            <el-table-column prop="authority_group" label="用户组" width="150" sortable>
                <template slot-scope="scope">
                    <el-select v-model="scope.row.authority_group" @change="modify(scope)" size="mini">
                        <el-option v-for="item in authtype" :key="item.value" :label="item.label" :value="item.value"></el-option>
                    </el-select>
                </template>
            </el-table-column>
            <el-table-column prop="last_login_time" label="上次登录时间" width="200" sortable>
                <template slot-scope="scope">
                    [[ datestr(scope.row.last_login_time) ]]
                </template>
            </el-table-column>
            <el-table-column prop="last_login_ipaddr" label="上次登录IP地址" width="150"></el-table-column>
            <el-table-column label="删除" width="30">
                <template slot-scope="scope">
                        <el-button type="text" @click="delete_user(scope)" icon="el-icon-delete"></el-button>
                </template>
            </el-table-column>
        </el-table>
    </div>
</body>
<script>
    var api_path = "{{ url_for('yobot_users_api') }}";
    var csrf_token = "{{ session['csrf_token'] }}";
</script>
<script src="{{ url_for('yobot_static', filename='admin/users.js') }}"></script>

</html>